/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package device;

/**
 *
 * @author Kostya Black Jopa
 */
public class EthernetAdapter extends Device{
    private int speed;
    private String mac;

    public EthernetAdapter(int speed, String mac, String manufacturer, float price, String serialNumber) {
        super(manufacturer, price, serialNumber);
        this.speed = speed;
        this.mac = mac;
    }

    public String getMac() {
        return mac;
    }

    public void setMac(String mac) {
        this.mac = mac;
    }

    public int getSpeed() {
        return speed;
    }

    public void setSpeed(int speed) {
        this.speed = speed;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final EthernetAdapter other = (EthernetAdapter) obj;
        if (this.speed != other.speed) {
            return false;
        }
        if ((this.mac == null) ? (other.mac != null) : !this.mac.equals(other.mac)) {
            return false;
        }
        return true;
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 59 * hash + this.speed;
        hash = 59 * hash + (this.mac != null ? this.mac.hashCode() : 0);
        return hash;
    }

    @Override
    public String toString() {
        return "EthernetAdapter{" + super.toString() + " speed=" + speed + ", mac=" + mac + '}';
    }
    
}
